]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
networkAgent: Fix layout for RTL locales
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Jun 2014 14:41:22 +0000 (16:41 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 24 Jun 2014 21:37:35 +0000 (23:37 +0200)
Unlike StTable, ClutterTableLayout does not take the actor's text
direction into account, so mirror columns ourselves now.

https://bugzilla.gnome.org/show_bug.cgi?id=731923

js/ui/components/networkAgent.js

index 181aa77c1cb98db9e1f61e3f0b9f1ec28fa0f889..1a27fe63830cc054b38e464bf97c625afd76a232 100644 (file)
@@ -77,6 +77,7 @@ const NetworkSecretDialog = new Lang.Class({
                                           layout_manager: layout });
         layout.hookup_style(secretTable);
 
+        let rtl = secretTable.get_text_direction() == Clutter.TextDirection.RTL;
         let initialFocusSet = false;
         let pos = 0;
         for (let i = 0; i < this._content.secrets.length; i++) {
@@ -116,10 +117,15 @@ const NetworkSecretDialog = new Lang.Class({
             } else
                 secret.valid = true;
 
-            layout.pack(label, 0, pos);
+            if (rtl) {
+                layout.pack(secret.entry, 0, pos);
+                layout.pack(label, 1, pos);
+            } else {
+                layout.pack(label, 0, pos);
+                layout.pack(secret.entry, 1, pos);
+            }
             layout.child_set(label, { x_expand: false, y_fill: false,
                                       x_align: Clutter.TableAlignment.START });
-            layout.pack(secret.entry, 1, pos);
             pos++;
 
             if (secret.password)